/*
 * 
 *  Este arquivo é parte do software TODO Calculadora. TODO Calculadora é um software livre;
 *  você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU
 *  como publicada pela Fundação do Software Livre (FSF); na versão 2 da Licença,
 *  ou (na sua opnião) qualquer versão.
 *  
 *	Este programa é distribuido na esperança que possa ser útil, mas SEM NENHUMA GARANTIA;
 *  sem uma garantia implícita de ADEQUAÇÂO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR.
 *  Veja a Licença Pública Geral GNU para maiores detalhes. Você deve ter recebido uma cópia
 *  da Licença Pública Geral GNU junto com este programa, se não, escreva para a Fundação do
 *	Software Livre(FSF)
 *
 *	Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

package gui;

import javax.swing.JTextField;

import util.gui.CalculadorGUIUtil;

/**
 * Classe que representa a tela da calculadora
 * 
 * @author Willyan Guimarães Caetano
 */
public class Tela extends javax.swing.JFrame {

	public Tela() {
		initComponents();
		configuraDisplay();
	}

	/**
	 * Configura o "display" da calculadora para questões de validação, foco,
	 * valor inicial e alinhamento dos números.
	 */
	private void configuraDisplay() {
		insereValidacoesCampo();
		/* Alinha a direita o campo de texto */
		textoValor.setHorizontalAlignment(JTextField.RIGHT);
	}

	/**
	 * Insere validações que delimitam o tamanho do campo numérico e também
	 * permite apenas números a serem inseridos no campo
	 */
	private void insereValidacoesCampo() {
		textoValor.setDocument(new TextDocument(
				CalculadorGUIUtil.tamanhoMaximoCampo));

		// textoValor.addKeyListener(new java.awt.event.KeyAdapter() {
		// public void keyReleased(java.awt.event.KeyEvent evt) {
		// textoValor.setText(textoValor.getText().replaceAll(
		// "[^0-9]", ""));
		// }
		// });
		textoValor.getCaret().setVisible(false);
	}

	/**
	 * Método utilizada para construir o form. Chamado na construção da classe.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed"
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        textoValor = new javax.swing.JTextField();
        painelNumeros = new javax.swing.JPanel();
        botaoUm = new javax.swing.JButton();
        botaoDois = new javax.swing.JButton();
        botaoTres = new javax.swing.JButton();
        botaoQuatro = new javax.swing.JButton();
        botaoCinco = new javax.swing.JButton();
        botaoSeis = new javax.swing.JButton();
        botaoSete = new javax.swing.JButton();
        botaoOito = new javax.swing.JButton();
        botaoNove = new javax.swing.JButton();
        botaoVirgula = new javax.swing.JButton();
        botaoZero = new javax.swing.JButton();
        botaoPositivoNegativo = new javax.swing.JButton();
        painelOperacoesBasicas = new javax.swing.JPanel();
        botaoAdicao = new javax.swing.JButton();
        botaoDivisao = new javax.swing.JButton();
        botaoSubtracao = new javax.swing.JButton();
        botaoMultiplicacao = new javax.swing.JButton();
        painelFuncoes = new javax.swing.JPanel();
        botaoFatorial = new javax.swing.JButton();
        botaoRaiz = new javax.swing.JButton();
        botaoLogaritmo = new javax.swing.JButton();
        botaoResultado = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Universus 0.4");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setIconImage(java.awt.Toolkit.getDefaultToolkit().getImage(getClass().getResource("/calculator-icon.png")));
        getContentPane().setLayout(null);

        textoValor.setFont(new java.awt.Font("Courier New", 0, 47)); // NOI18N
        getContentPane().add(textoValor);
        textoValor.setBounds(20, 20, 510, 37);

        painelNumeros.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        botaoUm.setText("1");
        botaoUm.setToolTipText("1");
        botaoUm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoUmActionPerformed(evt);
            }
        });

        botaoDois.setText("2");
        botaoDois.setToolTipText("2");
        botaoDois.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoDoisActionPerformed(evt);
            }
        });

        botaoTres.setText("3");
        botaoTres.setToolTipText("3");
        botaoTres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoTresActionPerformed(evt);
            }
        });

        botaoQuatro.setText("4");
        botaoQuatro.setToolTipText("4");
        botaoQuatro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoQuatroActionPerformed(evt);
            }
        });

        botaoCinco.setText("5");
        botaoCinco.setToolTipText("5");
        botaoCinco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoCincoActionPerformed(evt);
            }
        });

        botaoSeis.setText("6");
        botaoSeis.setToolTipText("6");
        botaoSeis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoSeisActionPerformed(evt);
            }
        });

        botaoSete.setText("7");
        botaoSete.setToolTipText("7");
        botaoSete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoSeteActionPerformed(evt);
            }
        });

        botaoOito.setText("8");
        botaoOito.setToolTipText("8");
        botaoOito.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoOitoActionPerformed(evt);
            }
        });

        botaoNove.setText("9");
        botaoNove.setToolTipText("9");
        botaoNove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoNoveActionPerformed(evt);
            }
        });

        botaoVirgula.setText(",");
        botaoVirgula.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoVirgulaActionPerformed(evt);
            }
        });

        botaoZero.setText("0");
        botaoZero.setToolTipText("0");
        botaoZero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoZeroActionPerformed(evt);
            }
        });

        botaoPositivoNegativo.setText("+/-");
        botaoPositivoNegativo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoPositivoNegativoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout painelNumerosLayout = new javax.swing.GroupLayout(painelNumeros);
        painelNumeros.setLayout(painelNumerosLayout);
        painelNumerosLayout.setHorizontalGroup(
            painelNumerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelNumerosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelNumerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelNumerosLayout.createSequentialGroup()
                        .addComponent(botaoQuatro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botaoCinco, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11)
                        .addComponent(botaoSeis, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(painelNumerosLayout.createSequentialGroup()
                        .addComponent(botaoSete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botaoOito, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botaoNove, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(painelNumerosLayout.createSequentialGroup()
                        .addComponent(botaoVirgula, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botaoZero, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botaoPositivoNegativo, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(painelNumerosLayout.createSequentialGroup()
                        .addComponent(botaoUm, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11)
                        .addComponent(botaoDois, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(botaoTres, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 2, Short.MAX_VALUE)))
                .addContainerGap())
        );
        painelNumerosLayout.setVerticalGroup(
            painelNumerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelNumerosLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelNumerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoUm)
                    .addComponent(botaoDois)
                    .addComponent(botaoTres))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelNumerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoQuatro)
                    .addComponent(botaoCinco)
                    .addComponent(botaoSeis))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelNumerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoSete)
                    .addComponent(botaoOito)
                    .addComponent(botaoNove))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelNumerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoVirgula)
                    .addComponent(botaoZero)
                    .addComponent(botaoPositivoNegativo))
                .addContainerGap(20, Short.MAX_VALUE))
        );

        getContentPane().add(painelNumeros);
        painelNumeros.setBounds(20, 70, 220, 160);

        painelOperacoesBasicas.setBorder(javax.swing.BorderFactory.createTitledBorder("Operações básicas"));

        botaoAdicao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Math-plus-icon.png"))); // NOI18N
        botaoAdicao.setToolTipText("Soma");
        botaoAdicao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoAdicaoActionPerformed(evt);
            }
        });

        botaoDivisao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Math-divide-icon.png"))); // NOI18N
        botaoDivisao.setToolTipText("Divide");
        botaoDivisao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoDivisaoActionPerformed(evt);
            }
        });

        botaoSubtracao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Math-minus-icon.png"))); // NOI18N
        botaoSubtracao.setToolTipText("Subtrai");
        botaoSubtracao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoSubtracaoActionPerformed(evt);
            }
        });

        botaoMultiplicacao.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Math-multiply-icon.png"))); // NOI18N
        botaoMultiplicacao.setToolTipText("Multiplica");
        botaoMultiplicacao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoMultiplicacaoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout painelOperacoesBasicasLayout = new javax.swing.GroupLayout(painelOperacoesBasicas);
        painelOperacoesBasicas.setLayout(painelOperacoesBasicasLayout);
        painelOperacoesBasicasLayout.setHorizontalGroup(
            painelOperacoesBasicasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelOperacoesBasicasLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelOperacoesBasicasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelOperacoesBasicasLayout.createSequentialGroup()
                        .addComponent(botaoAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botaoDivisao, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(painelOperacoesBasicasLayout.createSequentialGroup()
                        .addComponent(botaoMultiplicacao, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botaoSubtracao, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(12, Short.MAX_VALUE))
        );
        painelOperacoesBasicasLayout.setVerticalGroup(
            painelOperacoesBasicasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelOperacoesBasicasLayout.createSequentialGroup()
                .addGroup(painelOperacoesBasicasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botaoDivisao, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelOperacoesBasicasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoMultiplicacao, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botaoSubtracao, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 12, Short.MAX_VALUE))
        );

        getContentPane().add(painelOperacoesBasicas);
        painelOperacoesBasicas.setBounds(250, 70, 140, 120);

        painelFuncoes.setBorder(javax.swing.BorderFactory.createTitledBorder("Funções"));

        botaoFatorial.setText("Fatorial (!)");
        botaoFatorial.setToolTipText("Fatorial (!)");
        botaoFatorial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoFatorialActionPerformed(evt);
            }
        });

        botaoRaiz.setText("Raiz");
        botaoRaiz.setToolTipText("Raiz Quadrada");
        botaoRaiz.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoRaizActionPerformed(evt);
            }
        });

        botaoLogaritmo.setText("Logaritmo");
        botaoLogaritmo.setToolTipText("Logaritmo base 2");
        botaoLogaritmo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoLogaritmoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout painelFuncoesLayout = new javax.swing.GroupLayout(painelFuncoes);
        painelFuncoes.setLayout(painelFuncoesLayout);
        painelFuncoesLayout.setHorizontalGroup(
            painelFuncoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelFuncoesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelFuncoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelFuncoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(botaoRaiz, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(botaoFatorial, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE))
                    .addComponent(botaoLogaritmo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        painelFuncoesLayout.setVerticalGroup(
            painelFuncoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelFuncoesLayout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(botaoFatorial)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botaoRaiz)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botaoLogaritmo)
                .addGap(0, 12, Short.MAX_VALUE))
        );

        getContentPane().add(painelFuncoes);
        painelFuncoes.setBounds(400, 70, 130, 120);

        botaoResultado.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Math-equal-icon.png"))); // NOI18N
        botaoResultado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoResultadoActionPerformed(evt);
            }
        });
        getContentPane().add(botaoResultado);
        botaoResultado.setBounds(250, 200, 140, 40);

        setSize(new java.awt.Dimension(559, 281));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

	private void botaoUmActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoUmActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.UM, textoValor));
	}// GEN-LAST:event_botaoUmActionPerformed

	private void botaoDoisActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoDoisActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.DOIS, textoValor));
	}// GEN-LAST:event_botaoDoisActionPerformed

	private void botaoTresActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoTresActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.TRES, textoValor));
	}// GEN-LAST:event_botaoTresActionPerformed

	private void botaoQuatroActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoQuatroActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.QUATRO, textoValor));
	}// GEN-LAST:event_botaoQuatroActionPerformed

	private void botaoCincoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoCincoActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.CINCO, textoValor));
	}// GEN-LAST:event_botaoCincoActionPerformed

	private void botaoSeisActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoSeisActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.SEIS, textoValor));
	}// GEN-LAST:event_botaoSeisActionPerformed

	private void botaoSeteActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoSeteActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.SETE, textoValor));
	}// GEN-LAST:event_botaoSeteActionPerformed

	private void botaoOitoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoOitoActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.OITO, textoValor));
	}// GEN-LAST:event_botaoOitoActionPerformed

	private void botaoNoveActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoNoveActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.NOVE, textoValor));
	}// GEN-LAST:event_botaoNoveActionPerformed

	private void botaoZeroActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoZeroActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.ZERO, textoValor));
	}// GEN-LAST:event_botaoZeroActionPerformed

	private void botaoRaizActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoRaizActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_botaoRaizActionPerformed

	private void botaoPositivoNegativoActionPerformed(
			java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoPositivoNegativoActionPerformed
		textoValor.setText(CalculadorGUIUtil
				.processaTeclaInversaoSinais(textoValor));
	}// GEN-LAST:event_botaoPositivoNegativoActionPerformed

	private void botaoResultadoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoResultadoActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_botaoResultadoActionPerformed

	private void botaoMultiplicacaoActionPerformed(
			java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoMultiplicacaoActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_botaoMultiplicacaoActionPerformed

	private void botaoSubtracaoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoSubtracaoActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_botaoSubtracaoActionPerformed

	private void botaoAdicaoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoAdicaoActionPerformed
		if(textoValor.getText().equals(""))
		{
			//
		}
	}// GEN-LAST:event_botaoAdicaoActionPerformed

	private void botaoDivisaoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoDivisaoActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_botaoDivisaoActionPerformed

	private void botaoFatorialActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoFatorialActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_botaoFatorialActionPerformed

	private void botaoLogaritmoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoLogaritmoActionPerformed
		// TODO add your handling code here:
	}// GEN-LAST:event_botaoLogaritmoActionPerformed

	private void botaoVirgulaActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_botaoVirgulaActionPerformed
		textoValor.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.VIRGULA, textoValor));
	}// GEN-LAST:event_botaoVirgulaActionPerformed

	public static void start() {
		/* Set the Nimbus look and feel */
		// <editor-fold defaultstate="collapsed"
		// desc=" Look and feel setting code (optional) ">
		/*
		 * If Nimbus (introduced in Java SE 6) is not available, stay with the
		 * default look and feel. For details see
		 * http://download.oracle.com/javase
		 * /tutorial/uiswing/lookandfeel/plaf.html
		 */
		try {
			for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager
					.getInstalledLookAndFeels()) {
				if ("Metal".equals(info.getName())) {
					javax.swing.UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		} catch (ClassNotFoundException ex) {
			java.util.logging.Logger.getLogger(Tela.class.getName()).log(
					java.util.logging.Level.SEVERE, null, ex);
		} catch (InstantiationException ex) {
			java.util.logging.Logger.getLogger(Tela.class.getName()).log(
					java.util.logging.Level.SEVERE, null, ex);
		} catch (IllegalAccessException ex) {
			java.util.logging.Logger.getLogger(Tela.class.getName()).log(
					java.util.logging.Level.SEVERE, null, ex);
		} catch (javax.swing.UnsupportedLookAndFeelException ex) {
			java.util.logging.Logger.getLogger(Tela.class.getName()).log(
					java.util.logging.Level.SEVERE, null, ex);
		}
		// </editor-fold>

		/* Create and display the form */
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new Tela().setVisible(true);
			}
		});
	}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botaoAdicao;
    private javax.swing.JButton botaoCinco;
    private javax.swing.JButton botaoDivisao;
    private javax.swing.JButton botaoDois;
    private javax.swing.JButton botaoFatorial;
    private javax.swing.JButton botaoLogaritmo;
    private javax.swing.JButton botaoMultiplicacao;
    private javax.swing.JButton botaoNove;
    private javax.swing.JButton botaoOito;
    private javax.swing.JButton botaoPositivoNegativo;
    private javax.swing.JButton botaoQuatro;
    private javax.swing.JButton botaoRaiz;
    private javax.swing.JButton botaoResultado;
    private javax.swing.JButton botaoSeis;
    private javax.swing.JButton botaoSete;
    private javax.swing.JButton botaoSubtracao;
    private javax.swing.JButton botaoTres;
    private javax.swing.JButton botaoUm;
    private javax.swing.JButton botaoVirgula;
    private javax.swing.JButton botaoZero;
    private javax.swing.JPanel painelFuncoes;
    private javax.swing.JPanel painelNumeros;
    private javax.swing.JPanel painelOperacoesBasicas;
    private javax.swing.JTextField textoValor;
    // End of variables declaration//GEN-END:variables
}
